define(['app'], function(app) {
	'use strict';

	//实例化方法
	var factory = function(Http) {

		//进行中的秒杀
	function get_data_list(result) {
		if(false) {
			result = '{"success":true,"msg":"","result":{"act":[{"act_id":"act_id_001","name":"新年促销","start_time":"2017/01/01 09:00:00","end_time":"2017/01/31 09:00:00","goods":{"goods_id":"001","name":"一字螺丝刀","video_id":"001","video":""}},{"act_id":"act_id_002","name":"新年促销","start_time":"2017/01/01 09:00:00","end_time":"2017/01/31 09:00:00","goods":{"goods_id":"002","name":"十字螺丝刀","video_id":"002","video":""}}]},"session":"7311da98bd0f18eb15a96bcb263f4153"}';
			return JSON.parse(result);
		} else {
			return result;
		}
	}

	// 返回信息
	return {
		get_list: function(nPage,callback,calldone) {
			Http.post({
					method: 'marketing.video.getlist',
					pagelimit: 10,
					nPage:nPage
				},
				function(result) {
					//请求成功
					if(callback)
						callback(get_data_list(result).result);
				},
				function(e) {
					//请求异常
				},
				function() {
					//请求完成，一般不做什么事情
					if(calldone)
                    calldone();

				});
		}


	};
}

	factory.$inject = ['Http'];
	return app.registerService("Newpro_ads", factory);
});
